package Zuoye3;

public class Voter {
    String name;  //名字
    private static int count;  //投票数

    public Voter() {
    }

    public Voter(String name) {
        this.name = name;
    }

    public void Vote() {
        if (count == 100) {
            System.out.println("投票活动已经结束！");
        } else {
            count++;
            System.out.println(this.name + "欢迎您投票，当前票数是：" + count);
        }
    }

    public static void main(String[] args) {
        for (int i = 0; i < 101; i++) {
            Voter v = new Voter("张三" + (i + 1));
            v.Vote();
        }
    }
}
